package com.hy.mydesktop.shared.persistence.domain.gxt;

import java.util.Map;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.extjs.gxt.ui.client.data.BaseModel;
import com.hy.mydesktop.shared.persistence.domain.gxt.constant.MetaDataConstants;

/**
 * 
 * 
 * <ul>
 * <li>开发作者：花宏宇</li>
 * <li>设计日期：2012-2-3；时间：上午10:51:45</li>
 * <li>类型名称：GxtAppEventType</li>
 * <li>设计目的：ExtGwt的Mvc中的事件的模型<br>
 * 包括：事件的Id，事件的名称，事件的描述</li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 */
@Entity
@Table(name="t_registerEventType")
//public class RegisterEventType extends BaseModel{
	public class GxtAppEventType extends BaseModel{
	
	public GxtAppEventType() {
		super();
	}

	public GxtAppEventType(Map<String, Object> properties) {
		super(properties);
	}
	
	public GxtAppEventType(String eventType) {
		super();
		//this.setId(UUID.randomUUID().toString());
		this.setRegisterEventType(eventType);
		this.setId(eventType);
	}

	@Id
	@Column(length=36)
	//@Transient
	
	public String getIdentifier() {
		return this.get(MetaDataConstants.IDENTIFIER);

		//return getId();
	}

	//@Id
	//@Column(length=36)
	
	public String getId() {
		return this.get(MetaDataConstants.ID);
	}

	
	public void setIdentifier(String identifier) {
		this.set(MetaDataConstants.IDENTIFIER, identifier);
		//this.set(MetaDataConstants.ID, identifier);

	}
	
	public void setId(String id) {
		//this.set(MetaDataConstants.IDENTIFIER, id);
		this.set(MetaDataConstants.ID, id);
	}
	
	
	public String getRegisterEventType() {
		return super.get(MetaDataConstants.APP_EVENT_TYPE_ID);
		//return super.get("registerEventType");
	}

	public void setRegisterEventType(String registerEventType) {
		super.set(MetaDataConstants.APP_EVENT_TYPE_ID, registerEventType);
		this.setId(registerEventType);

	}
	
	public String getEventTypeDescription() {
		return super.get(MetaDataConstants.EVENT_TYPE_DESCRIPTION);

		//return super.get("eventTypeDescription");
	}

	public void setEventTypeDescription(String eventTypeDescription) {
		super.set(MetaDataConstants.EVENT_TYPE_DESCRIPTION, eventTypeDescription);
	}

}
